<extend name="template/base_index" />


<block name="area_header">
    <link rel="stylesheet" type="text/css" media="all" href="__CDN__/jquery-datetimepicker/jquery.datetimepicker.css">
    <script type="text/javascript" src="__CDN__/jquery-datetimepicker/jquery.datetimepicker.js"></script>
</block>

<block name="area_body">
    {:W('Menus/topbar')}
    <div class="admin-main container-fluid">
        {:W('Menus/left')}
        <div class="admin-main-content">
            {:W('Menus/breadcrumb')}
            <div class="table-responsive well">
                <div class="h4">
                </div>
                <div class="form-control-static">
                    <form action="__SELF__" method="post" class="form-inline">
                        <div class="form-group">
                            <div class="input-group">
                                <input type="hidden" name="uid" value="{:I('get.uid')}">
                                <div class="input-group-addon">
                                    <i class="fa fa-calendar"></i>
                                </div>
                                <input type="text" name="startdatetime" id="startdatetime" class="form-control" value="{:date('Y/m/d H:i',$startdatetime)}" />
                                <div class="input-group-addon">
                                    <i class="fa fa-long-arrow-right"></i>
                                </div>
                                <input type="text" name="enddatetime" id="enddatetime" class="form-control" value="{:date('Y/m/d H:i',$enddatetime)}" />
                                <div class="input-group-addon">
                                    消息类型
                                </div>
                                <input type="text" name="msg_type" class="form-control" value="{$msg_type}" />
                            </div>
                        </div>
                        <button type="submit" class="btn btn-default btn-sm"><i class="fa fa-search"></i>{:L('BTN_SEARCH')}</button>
                    </form>
                </div>
                <div class="form-control-static">
                    <a href="{:U('Admin/Message/bulkDelete')}" class="confirm ajax-post btn btn-danger btn-sm" target-form="selectitem">{:L('BTN_SELECTED_DELETE')}</a>
                </div>
                <table class="table table-striped table table-hover  table-condensed">
                    <thead>
                    <tr>
                        <th>
                            <input type="checkbox" class="selectall" onclick="myUtils.selectall(this,'.selectitem');" />{:L('SELECT_ALL')}
                        </th>
                        <th>
                            标题
                        </th>
                        <th>
                            内容
                        </th>
                        <th>
                            接收人
                        </th>
                        <th>
                            类型
                        </th>
                        <th>
                            来源
                        </th>
                        <th>
                            摘要
                        </th>
                        <th>
                            发送时间
                        </th>
                        <th>
                            {:L('OPERATOR')}
                        </th>
                    </tr>
                    </thead>
                    <tbody>
                    <empty name="list">
                        <tr>
                            <td colspan="8" class="text-center">{:L('NO_DATA')}</td>
                        </tr>
                    </empty>
                    <volist name="list" id="vo">
                        <tr>
                            <td>
                                <input type="checkbox" value="{$vo.id}" name="ids[]" class="selectitem" />{$vo.id}</td>
                            <td>{$vo.title}</td>
                            <td>
                                <div style="width: 250px; overflow: hidden; text-overflow:ellipsis; white-space:nowrap; ">
                                    {$vo.content}
                                </div></td>
                            <td>
                                <if condition="$vo.to_id eq -2">所有人<else /><a href="{:U('Admin/CustomerInfo/index',array('id'=>$vo['to_id']))}">{$vo.to_id}</a>
                                </if>
                            </td>
                            <td>{$vo.name}</td>
                            <td>
                                <if condition="$vo.fromid eq 0">系统<else /><a href="{:U('Admin/CustomerInfo/index',array('id'=>$vo['from_id']))}">{$vo.from_id}</a>
                                </if>
                            </td>
                            <td>{$vo.summary}</td>
                            <td>{$vo.send_time|date="Y/m/d H:i:s",###}</td>
                            <td>
                                <a href="{:U(CONTROLLER_NAME .'/pushMessage',array('id'=>$vo['id']))}" class="btn btn-primary btn-sm ajax-get confirm"><i class="fa fa-envelope-o"></i> 推送消息</a>
                                <a href="{:U(CONTROLLER_NAME .'/delete',array('id'=>$vo['id']))}" class="btn btn-danger btn-sm ajax-get confirm"><i class="fa fa-trash-o"></i> {:L('BTN_DELETE')}</a>
                            </td>
                        </tr>

                    </volist>
                    </tbody>
                </table>
                <div>
                    {$show}
                </div>
            </div>

        </div>
    </div>
</block>

<block name="area_footer">
    <script type="text/javascript">
        $(function() {
            $('#startdatetime').datetimepicker({
                lang: 'ch'
            });
            $('#enddatetime').datetimepicker({
                lang: 'ch'
            });
        })
    </script>
</block>